{% extends "base.html" %}

{% block content %}

<script language="javascript" src="/static/js/jquery-1.2.1.pack.js" type="text/javascript"></script>
<script language="javascript" src="/static/js/tab.js" type="text/javascript"></script>
<script type="text/javascript" src="/static/js/jquery-calendar-pack.js" ></script>
<style type="text/css">@import url(/static/css/jquery-calendar.css);</style>
<script language="javascript" type="text/javascript">
$(document).ready
(
function()
{
    	popUpCal.regional['zh-cn'] = {
		dateFormat: 'YMD-'};
	popUpCal.setDefaults(popUpCal.regional['zh-cn']);
   $('#start_date').calendar({autoPopUp: 'focus',yearRange: '-10:+0'});
	$('#end_date').calendar({autoPopUp: 'focus',yearRange: '-10:+0'});

   });
 </script>
 <style>
 .list-div {
  width: 96%;
  background: #BBDDE5;
  border: 1px solid #BBDDE5;
}
.list-div table {
  border: 1px solid #BBDDE5;
}
.list-div th {
  line-height: 24px;
  background: #BBDDE5 url("/static/images/th_bg.gif") repeat-x;
  white-space: nowrap;
}

.list-div td {
  background: #FFF;
  line-height: 22px;
}
tr.over td {background:#F4FAFB;  /*这个将是鼠标高亮行的背景臿/
} 
</style>

<div class="form-div">
  <form action="/statistics/agent/" name="searchForm" method='post'>
    <img src="/static/images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
	Program:<select name="p_id" id="p_id">
	<option value="0" {% ifequal p_id '0' %} selected="selected" {% endifequal %}>All</option>
{% for p in project_list %}
<option value="{{p.id}}" {% ifequal p.id p_id %} selected="selected" {% endifequal %}>{{p.name}}</option>
{% endfor %}
</select> From:<input type="text" id="start_date" name="start_date" value="{% if start_date %}{{start_date}}{% else %}begin{% endif %}" size="20" readonly="true"/>   To:<input type="text" id="end_date" name="end_date" value="{% if end_date %}{{end_date}}{% else %}now{% endif %}" size="20" readonly="true"/> 
<input type="submit" value="Search" class="button" />
  </form>
</div>

<!-- start goods form -->
<div class="tab-div">
    <!-- tab bar -->
    <div id="tabbar-div">
      <p>
        <span class="tab-front" id="general-tab">General Info</span><span
        class="tab-back" id="detail-tab">Interest level</span><span
        class="tab-back" id="mix-tab">Follow_up Status</span>
      </p>
    </div>

    <!-- tab body -->
    <div id="tabbody-div" class="list-div">
        <!-- 通用信息 -->
        <table width="90%" id="general-table" align="center">
          <tr>
            <th >Agent</th>
            <th >members</th><th >Received email</th><th >Received hardcopy</th><th >Cost/per members</th><th >Cost/per enrroled</th>
          </tr>
          {% for a in agent %}
		  <tr class="{% cycle row,over %}">
		  <td>{{a.name}}</td><td>{{a.member}} /({{a.pmembers}})</td><td  >{{a.pemail}}</td>
  <td>{{a.phardcopy}}</td><td>{{a.pcost}}</td><td>{{a.pbudget}}</td>
  </tr>
{% endfor %}
        </table>

        <!-- 详细描述 -->
        <table width="90%" id="detail-table" style="display:none">
           <tr>
            <th >Agent</th>
            <th >level 0</th><th >level 1</th><th >level 2</th><th >level 3</th><th >level 4</th>
          </tr>
          {% for a in agent %}
		  <tr class="{% cycle row,over %}">
		  <td>{{a.name}}</td><td>{{a.pi_0}}</td><td  >{{a.pi_1}}</td>
  <td>{{a.pi_2}}</td> <td>{{a.pi_3}}</td> <td>{{a.pi_4}}</td>
  </tr>
   {% endfor %}
   <tr>
<td colspan='6' >level 0:Doesn't cantact yet<br />
level 1:High Interest<br />
level 2:Some Interest<br />
level 3:No Interest<br />
level 4:Consider next time</td>
</tr>
   </table>

        <!-- 其他信息 -->
        <table width="90%" id="mix-table" style="display:none" align="center">
           <tr>
            <th >Agent</th>
            <th >status 0</th><th >status 1</th><th >status 2</th><th >status 3</th><th >status 4</th><th >status 5</th><th >status 6</th><th >status 7</th>
          </tr>
          {% for a in agent %}
		  <tr class="{% cycle row,over %}">
		  <td>{{a.name}}</td><td>{{a.ps_0}}</td><td  >{{a.ps_1}}</td>
  <td>{{a.ps_2}}</td> <td>{{a.ps_3}}</td> <td>{{a.ps_4}}</td><td>{{a.ps_5}}</td><td>{{a.ps_6}}</td><td>{{a.ps_7}}</td>
  </tr>
   {% endfor %}
   <tr>
<td colspan='9' >status 0:Doesn't cantact yet<br />
status 1:Cannot be reached<br />
status 2:Appointment scheduled<br />
status 3:Under consideration<br />
status 4:Please call later<br />
status 5:Schdule conflict/next time<br />
status 6:Don't call again<br />
status 7:Enrolled</td>
</tr>
        </table>


    </div>
</div>

{% endblock %}